package com.jason.mvptest2.model;

import android.util.SparseArray;

import com.jason.mvptest2.bean.UserBean;

public class UserModel implements IUserModel {

	private String mUerName;
	private String mPassWord;
	private int mID;
	private SparseArray<UserBean> mUsererArray = new SparseArray<UserBean>();


	@Override
	public void setID(int id) {
		mID = id;
	}

	@Override
	public void setUserName(String userName) {
		this.mUerName = userName;
	}

	@Override
	public void setPassWord(String passWord) {
		this.mPassWord = passWord;
		UserBean userBean = new UserBean(mUerName, mPassWord);
		mUsererArray.append(mID, userBean);

	}

	@Override
	public int getID() {
		return mID;
	}

	@Override
	public UserBean load(int id) {
		mID = id;
		UserBean userBean = mUsererArray.get(mID, new UserBean("not found",
				"not found"));
		return userBean;
	}
}